package Thread;

public class Demo8 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 =new Thread(()->{
            for(int i =0;i<3;i++){
                System.out.println(Thread.currentThread().getName()+":"+i);
            }
        });
        //线程结束，但是Thread对象仍然存在
        System.out.println(t1.isAlive());
        t1.start();

        while (true) {
            System.out.println(t1.isAlive());
            Thread.sleep(1000);
        }
    }
}
